<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateFlowChannelStatsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('flow_channel_stats', function (Blueprint $table) {
            $table->id();
            $table->unsignedInteger('flow_channel_id')->nullable()->comment('流量源ID');
            $table->integer('ip_num')->comment('ip数');
            $table->integer('pv')->comment('pv');
            $table->integer('uv')->comment('uv');
            $table->date('date')->comment('日期');
            $table->integer('hour')->comment('小时');
            $table->decimal('read_num_incr',10,2)->comment('阅读增量');
            $table->decimal('divide_amount',10,4)->comment('分成金额');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('flow_channel_stats');
    }
}
